********************************************************************************
* Project: Labor Market After Great Recession & Great Recession Scarring
* Program Description: Read CPSB monthly data and save as base stata datasets
* PI: Jesse Rothstein********************************************************************************
* Project: Labor Market After Great Recession & Great Recession Scarring
* Program Description: Read CPSB monthly data and save as base stata datasets
* PI: Jesse Rothstein
* Modified: Nicolas Ghio, 8/23/2018: Updated through 7/19 CPS.
* Modified: Nathaniel Ruby, 8/23/2018: Updated through 6/18 CPS.
* Modified: Rachel Young, 5/16/2018: Updated through 12/17 CPS
* Modified: Rachel Young, 1/4/2018: Revised to extend back to 1979. 
* Modified: Jesse Rothstein, 12/28/15: Updated through 11/15 CPS
* Modified: Peter Jones on 5/22/15
* Previously Modified: Apurba Chakraborty (5/2/14)
* Created: Tommy Drake (8/11/11)
********************************************************************************
/*Notes:
	
	0) Updated 5/22/15 to include data through 4/15, 7/11/17 for data through 5/17

	1) Individual do files and dictionaries are directly from NBER. This
	program is a master read in for all of those do files.
	
	2) A period is added after the ${rawdata} in all of the NBER do files
	for raw data that does not have a suffix.
	
	3) There was an issue with disk quota so all basedata files are
	currently being compressed using gzip.
	
	4) The observations counts from http://thedataweb.rm.census.gov/ftp/cps_ftp.html
	to check that all obs were read in correctly. The actual counts don't 
	match the CPS counts in certain years, so this should be checked later.
	
	5) Jan 2010 NBER program was modified to read in all vars instead of
	just the given subset.
	
	6) The jan89 and jan92 dictionary files were incorrectly reading the
	adult final weight as longs instead of doubles.  The dictionary files
	were modified to change this and now are labeled as _modified.  The
	dictionary path in the jan89 and jan92 nber .do files was also
	modified to use these new dictionaries.
	
	7) Program Documentation: cr_cpsb                                     
	
	8) The program was written to run under version 13. To run under version 14,
	   and still produce files that can be read under version 11, it seems
	   that it will be necessary to edit the saveold statement in each of the cps 
	   read files.
	   
	9) Several global directories are hard-coded. See section I below.
*/
	
********************************************************************************
capture log close
log using readrawcps.log, replace 
set more off
clear *
program drop _all
set memory 1000m
set type double, perm
version 14

********************************************************************************
* I. Configure Directories
********************************************************************************
global scratch = "~/labormarket"
global cps     = "~/data/cps/bigcps/statafmt"
global rawcps  = "~/data/cps/bigcps/raw"
global rawdir  = "$scratch"
global progdir = "cpssupplemental"
global dictdir = "cpssupplemental"
global basedir = "$cps"

cd ~/data/cps/bigcps/programs
********************************************************************************
* II. Define Program to Read in Raw Data (01/1978 - 03/2014)
********************************************************************************

// 1: program name, 2: raw dataset name, 3: base dataset name, 4: obs count
program readraw 
	global pgm = "`1'"
	global rawdata = "tmp_`2'"
	global basedata = "`3'"
	!zcat ${rawcps}/`2'.Z > ${rawdir}/tmp_`2'
	clear *
	do ${progdir}/`1'.do
	if `4'~=. {
		assert _N==`4'
	}
	!rm -f ${rawdir}/tmp_`2'
	!rm -f ${basedir}/${basedata}.dta.gbytez
	!gzip ${basedir}/${basedata}.dta
	macro drop pgm rawdata basedata
end



********************************************************************************
* IV. Define Program to Read in Raw Data (04/2014 - )
********************************************************************************
// Defines readraw2 which is readraw for .gz instead of .Z raw files
// Code would not run with this program defined above, which explains the order
program readraw2 
	global pgm = "`1'"
	global rawdata = "tmp_`2'"
	global basedata = "`3'"
	!zcat ${rawcps}/`2'.gz > ${rawdir}/tmp_`2' // only change vs. readraw
	clear *
	do ${progdir}/`1'.do
	if `4'~=. {
		assert _N==`4'
	}
	!rm -f ${rawdir}/tmp_`2'
	!rm -f ${basedir}/${basedata}.dta.gz
	!gzip ${basedir}/${basedata}.dta
	macro drop pgm rawdata basedata
end



********************************************************************************
* III. Actually Read in Raw Data (01/1978 - 06/2015)
********************************************************************************

*January 1979-December 1981

/*

forvalues yy=80/81 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps81 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}


forvalues yy=79/79 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps76 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}
forvalues yy=82/82 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps82 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}

*January 1983-December 1988
forvalues yy=83/83 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps83 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}

forvalues yy=84/84 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps84 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}

forvalues yy=85/85 {
	foreach mm in 01 02 03 04 05 06  {
		readraw readcps84 cpsb`yy'`mm' cpsb`yy'`mm' .
		}
}

forvalues yy=85/85 {
	foreach mm in 07 08 09 10 11 12 {
		readraw readcps85 cpsb`yy'`mm' cpsb`yy'`mm' .
		}
}

forvalues yy=86/88 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps86 cpsb`yy'`mm' cpsb`yy'`mm' . 
	}
}




*January 1989-December 1991
readraw cpsbjan89 cpsb8901 cpsb8901 .
readraw cpsbjan89 cpsb8902 cpsb8902 .
readraw cpsbjan89 cpsb8903 cpsb8903 .
readraw cpsbjan89 cpsb8904 cpsb8904 .
readraw cpsbjan89 cpsb8905 cpsb8905 .
readraw cpsbjan89 cpsb8906 cpsb8906 .
readraw cpsbjan89 cpsb8907 cpsb8907 .
readraw cpsbjan89 cpsb8908 cpsb8908 .
readraw cpsbjan89 cpsb8909 cpsb8909 .
readraw cpsbjan89 cpsb8910 cpsb8910 .
readraw cpsbjan89 cpsb8911 cpsb8911 .
readraw cpsbjan89 cpsb8912 cpsb8912 .
readraw cpsbjan89 cpsb9001 cpsb9001 .
readraw cpsbjan89 cpsb9002 cpsb9002 .
readraw cpsbjan89 cpsb9003 cpsb9003 .
readraw cpsbjan89 cpsb9004 cpsb9004 .
readraw cpsbjan89 cpsb9005 cpsb9005 .
readraw cpsbjan89 cpsb9006 cpsb9006 .
readraw cpsbjan89 cpsb9007 cpsb9007 .
readraw cpsbjan89 cpsb9008 cpsb9008 .
readraw cpsbjan89 cpsb9009 cpsb9009 .
readraw cpsbjan89 cpsb9010 cpsb9010 .
readraw cpsbjan89 cpsb9011 cpsb9011 .
readraw cpsbjan89 cpsb9012 cpsb9012 .
readraw cpsbjan89 cpsb9101 cpsb9101 .
readraw cpsbjan89 cpsb9102 cpsb9102 .
readraw cpsbjan89 cpsb9103 cpsb9103 .
readraw cpsbjan89 cpsb9104 cpsb9104 .
readraw cpsbjan89 cpsb9105 cpsb9105 .
readraw cpsbjan89 cpsb9106 cpsb9106 .
readraw cpsbjan89 cpsb9107 cpsb9107 .
readraw cpsbjan89 cpsb9108 cpsb9108 .
readraw cpsbjan89 cpsb9109 cpsb9109 .
readraw cpsbjan89 cpsb9110 cpsb9110 .
readraw cpsbjan89 cpsb9111 cpsb9111 .
readraw cpsbjan89 cpsb9112 cpsb9112 .


*January 1992-December 1993
readraw cpsbjan92 cpsb9201 cpsb9201 .
readraw cpsbjan92 cpsb9202 cpsb9202 .
readraw cpsbjan92 cpsb9203 cpsb9203 .
readraw cpsbjan92 cpsb9204 cpsb9204 .
readraw cpsbjan92 cpsb9205 cpsb9205 .
readraw cpsbjan92 cpsb9206 cpsb9206 .
readraw cpsbjan92 cpsb9207 cpsb9207 .
readraw cpsbjan92 cpsb9208 cpsb9208 .
readraw cpsbjan92 cpsb9209 cpsb9209 .
readraw cpsbjan92 cpsb9210 cpsb9210 .
readraw cpsbjan92 cpsb9211 cpsb9211 .
readraw cpsbjan92 cpsb9212 cpsb9212 .
readraw cpsbjan92 cpsb9301 cpsb9301 .
readraw cpsbjan92 cpsb9302 cpsb9302 .
readraw cpsbjan92 cpsb9303 cpsb9303 .
readraw cpsbjan92 cpsb9304 cpsb9304 .
readraw cpsbjan92 cpsb9305 cpsb9305 .
readraw cpsbjan92 cpsb9306 cpsb9306 .
readraw cpsbjan92 cpsb9307 cpsb9307 .
readraw cpsbjan92 cpsb9308 cpsb9308 .
readraw cpsbjan92 cpsb9309 cpsb9309 .
readraw cpsbjan92 cpsb9310 cpsb9310 .
readraw cpsbjan92 cpsb9311 cpsb9311 .
readraw cpsbjan92 cpsb9312 cpsb9312 .


*January 1994-March 1994
readraw cpsbjan94 cpsb9401 cpsb9401 156337
readraw cpsbjan94 cpsb9402 cpsb9402 156246
readraw cpsbjan94 cpsb9403 cpsb9403 156011

*April 1994-May 1995
readraw cpsbapr94 cpsb9404 cpsb9404 155618
readraw cpsbapr94 cpsb9405 cpsb9405 154665
readraw cpsbapr94 cpsb9406 cpsb9406 153572
readraw cpsbapr94 cpsb9407 cpsb9407 152303 //Given number is 151615
readraw cpsbapr94 cpsb9408 cpsb9408 151615
readraw cpsbapr94 cpsb9409 cpsb9409 151374
readraw cpsbapr94 cpsb9410 cpsb9410 153030
readraw cpsbapr94 cpsb9411 cpsb9411 153456 //Given number is 153238
readraw cpsbapr94 cpsb9412 cpsb9412 153238
readraw cpsbapr94 cpsb9501 cpsb9501 154317
readraw cpsbapr94 cpsb9502 cpsb9502 153530
readraw cpsbapr94 cpsb9503 cpsb9503 153380
readraw cpsbapr94 cpsb9504 cpsb9504 153418
readraw cpsbapr94 cpsb9505 cpsb9505 153817 //Given number is 153530

*June 1995-August 1995
readraw cpsbjun95 cpsb9506 cpsb9506 154299
readraw cpsbjun95 cpsb9507 cpsb9507 153720
readraw cpsbjun95 cpsb9508 cpsb9508 154227 //Given number is 154072

*September 1995-December 1997
readraw cpsbsep95 cpsb9509 cpsb9509 148986
readraw cpsbsep95 cpsb9510 cpsb9510 148392 
readraw cpsbsep95 cpsb9511 cpsb9511 148390 //Given number is 133424
readraw cpsbsep95 cpsb9512 cpsb9512 146878 
readraw cpsbsep95 cpsb9601 cpsb9601 132951 //Given number is 133424
readraw cpsbsep95 cpsb9602 cpsb9602 133424
readraw cpsbsep95 cpsb9603 cpsb9603 133240
readraw cpsbsep95 cpsb9604 cpsb9604 134340
readraw cpsbsep95 cpsb9605 cpsb9605 134271
readraw cpsbsep95 cpsb9606 cpsb9606 134753
readraw cpsbsep95 cpsb9607 cpsb9607 134509
readraw cpsbsep95 cpsb9608 cpsb9608 134817
readraw cpsbsep95 cpsb9609 cpsb9609 135479
readraw cpsbsep95 cpsb9610 cpsb9610 135845
readraw cpsbsep95 cpsb9611 cpsb9611 136279 //Given number is 136242
readraw cpsbsep95 cpsb9612 cpsb9612 136242
readraw cpsbsep95 cpsb9701 cpsb9701 135326
readraw cpsbsep95 cpsb9702 cpsb9702 134378
readraw cpsbsep95 cpsb9703 cpsb9703 134070
readraw cpsbsep95 cpsb9704 cpsb9704 134538
readraw cpsbsep95 cpsb9705 cpsb9705 135116
readraw cpsbsep95 cpsb9706 cpsb9706 135323
readraw cpsbsep95 cpsb9707 cpsb9707 134589
readraw cpsbsep95 cpsb9708 cpsb9708 135259
readraw cpsbsep95 cpsb9709 cpsb9709 135984
readraw cpsbsep95 cpsb9710 cpsb9710 135599
readraw cpsbsep95 cpsb9711 cpsb9711 135785
readraw cpsbsep95 cpsb9712 cpsb9712 135009

*January 1998-December 2002
readraw cpsbjan98 jan98pub.cps cpsb9801 134961
readraw cpsbjan98 feb98pub.cps cpsb9802 134413
readraw cpsbjan98 mar98pub.cps cpsb9803 134134
readraw cpsbjan98 apr98pub.cps cpsb9804 134516
readraw cpsbjan98 may98pub.cps cpsb9805 135411
readraw cpsbjan98 jun98pub.cps cpsb9806 134996
readraw cpsbjan98 jul98pub.cps cpsb9807 134948
readraw cpsbjan98 aug98pub.cps cpsb9808 135216
readraw cpsbjan98 sep98pub.cps cpsb9809 135549
readraw cpsbjan98 oct98pub.cps cpsb9810 135673
readraw cpsbjan98 nov98pub.cps cpsb9811 136186
readraw cpsbjan98 dec98pub.cps cpsb9812 135977
readraw cpsbjan98 jan99pub.cps cpsb9901 135889
readraw cpsbjan98 feb99pub.cps cpsb9902 135051
readraw cpsbjan98 mar99pub.cps cpsb9903 134693
readraw cpsbjan98 apr99pub.cps cpsb9904 134951
readraw cpsbjan98 may99pub.cps cpsb9905 134994
readraw cpsbjan98 jun99pub.cps cpsb9906 135577
readraw cpsbjan98 jul99pub.cps cpsb9907 135522
readraw cpsbjan98 aug99pub.cps cpsb9908 136259
readraw cpsbjan98 sep99pub.cps cpsb9909 136622
readraw cpsbjan98 oct99pub.cps cpsb9910 136710
readraw cpsbjan98 nov99pub.cps cpsb9911 137790
readraw cpsbjan98 dec99pub.cps cpsb9912 136387
readraw cpsbjan98 jan00pub.cps cpsb0001 137006
readraw cpsbjan98 feb00pub.cps cpsb0002 135570
readraw cpsbjan98 mar00pub.cps cpsb0003 134462
readraw cpsbjan98 apr00pub.cps cpsb0004 135624
readraw cpsbjan98 may00pub.cps cpsb0005 135557
readraw cpsbjan98 jun00pub.cps cpsb0006 135488 //Given number is 135448
readraw cpsbjan98 jul00pub.cps cpsb0007 135163
readraw cpsbjan98 aug00pub.cps cpsb0008 134986
readraw cpsbjan98 sep00pub.cps cpsb0009 134856
readraw cpsbjan98 oct00pub.cps cpsb0010 135283
readraw cpsbjan98 nov00pub.cps cpsb0011 134723
readraw cpsbjan98 dec00pub.cps cpsb0012 133870
readraw cpsbjan98 jan01pub.cps cpsb0101 133284
readraw cpsbjan98 feb01pub.cps cpsb0102 132182
readraw cpsbjan98 mar01pub.cps cpsb0103 130607
readraw cpsbjan98 apr01pub.cps cpsb0104 131302
readraw cpsbjan98 may01pub.cps cpsb0105 131997
readraw cpsbjan98 jun01pub.cps cpsb0106 131651
readraw cpsbjan98 jul01pub.cps cpsb0107 158353
readraw cpsbjan98 aug01pub.cps cpsb0108 158911
readraw cpsbjan98 sep01pub.cps cpsb0109 158865
readraw cpsbjan98 oct01pub.cps cpsb0110 158819
readraw cpsbjan98 nov01pub.cps cpsb0111 158335
readraw cpsbjan98 dec01pub.cps cpsb0112 157937
readraw cpsbjan98 jan02pub.cps cpsb0201 157946
readraw cpsbjan98 feb02pub.cps cpsb0202 157443
readraw cpsbjan98 mar02pub.cps cpsb0203 156821
readraw cpsbjan98 apr02pub.cps cpsb0204 158107
readraw cpsbjan98 may02pub.cps cpsb0205 158493
readraw cpsbjan98 jun02pub.cps cpsb0206 158681
readraw cpsbjan98 jul02pub.cps cpsb0207 159245
readraw cpsbjan98 aug02pub.cps cpsb0208 159058
readraw cpsbjan98 sep02pub.cps cpsb0209 159434
readraw cpsbjan98 oct02pub.cps cpsb0210 159887
readraw cpsbjan98 nov02pub.cps cpsb0211 159713
readraw cpsbjan98 dec02pub.cps cpsb0212 159657

*January 2003-April 2004
readraw cpsbjan03 jan03pub.cps cpsb0301 159376
readraw cpsbjan03 feb03pub.cps cpsb0302 158633
readraw cpsbjan03 mar03pub.cps cpsb0303 158721
readraw cpsbjan03 apr03pub.cps cpsb0304 159040
readraw cpsbjan03 may03pub.cps cpsb0305 158826
readraw cpsbjan03 jun03pub.cps cpsb0306 157585
readraw cpsbjan03 jul03pub.cps cpsb0307 156989
readraw cpsbjan03 aug03pub.cps cpsb0308 156654
readraw cpsbjan03 sep03pub.cps cpsb0309 157367
readraw cpsbjan03 oct03pub.cps cpsb0310 156941
readraw cpsbjan03 nov03pub.cps cpsb0311 156869
readraw cpsbjan03 dec03pub.cps cpsb0312 156967
readraw cpsbjan03 cpsb0401.dat cpsb0401 156887
readraw cpsbjan03 cpsb0402.dat cpsb0402 157544
readraw cpsbjan03 cpsb0403.dat cpsb0403 156542
readraw cpsbjan03 cpsb0404.dat cpsb0404 155410

*May 2004-July 2005
readraw cpsbmay04 cpsb0405.dat cpsb0405 155064
readraw cpsbmay04 cpsb0406.dat cpsb0406 153879
readraw cpsbmay04 cpsb0407.dat cpsb0407 152475
readraw cpsbmay04 cpsb0408.dat cpsb0408 153896
readraw cpsbmay04 cpsb0409.dat cpsb0409 154495
readraw cpsbmay04 cpsb0410.dat cpsb0410 155365
readraw cpsbmay04 cpsb0411.dat cpsb0411 156519
readraw cpsbmay04 cpsb0412.dat cpsb0412 155845
readraw cpsbmay04 cpsb0501.dat cpsb0501 156657
readraw cpsbmay04 cpsb0502.dat cpsb0502 155925
readraw cpsbmay04 cpsb0503.dat cpsb0503 154651
readraw cpsbmay04 cpsb0504.dat cpsb0504 155041
readraw cpsbmay04 cpsb0505.dat cpsb0505 154707
readraw cpsbmay04 cpsb0506.dat cpsb0506 154050
readraw cpsbmay04 cpsb0507.dat cpsb0507 153893

*August 2005-December 2006
readraw cpsbaug05 cpsb0508.dat cpsb0508 153649
readraw cpsbaug05 cpsb0509.dat cpsb0509 153087
readraw cpsbaug05 cpsb0510.dat cpsb0510 153937
readraw cpsbaug05 cpsb0511.dat cpsb0511 153636
readraw cpsbaug05 cpsb0512.dat cpsb0512 153049
readraw cpsbaug05 cpsb0601.dat cpsb0601 153550
readraw cpsbaug05 cpsb0602.dat cpsb0602 153382
readraw cpsbaug05 cpsb0603.dat cpsb0603 152738
readraw cpsbaug05 cpsb0604.dat cpsb0604 153597
readraw cpsbaug05 cpsb0605.dat cpsb0605 153344
readraw cpsbaug05 cpsb0606.dat cpsb0606 153219
readraw cpsbaug05 cpsb0607.dat cpsb0607 153525
readraw cpsbaug05 cpsb0608.dat cpsb0608 154149
readraw cpsbaug05 cpsb0609.dat cpsb0609 153397
readraw cpsbaug05 cpsb0610.dat cpsb0610 153244
readraw cpsbaug05 cpsb0611.dat cpsb0611 153255
readraw cpsbaug05 cpsb0612.dat cpsb0612 152962

*January 2007-December 2008
readraw cpsbjan07 cpsb0701.dat cpsb0701 152318
readraw cpsbjan07 cpsb0702.dat cpsb0702 152581
readraw cpsbjan07 cpsb0703.dat cpsb0703 152390
readraw cpsbjan07 cpsb0704.dat cpsb0704 153700
readraw cpsbjan07 cpsb0705.dat cpsb0705 154210
readraw cpsbjan07 cpsb0706.dat cpsb0706 153629
readraw cpsbjan07 cpsb0707.dat cpsb0707 152802
readraw cpsbjan07 cpsb0708.dat cpsb0708 152331
readraw cpsbjan07 cpsb0709.dat cpsb0709 151968
readraw cpsbjan07 cpsb0710.dat cpsb0710 151370
readraw cpsbjan07 cpsb0711.dat cpsb0711 151671 
readraw cpsbjan07 cpsb0712.dat cpsb0712 151431
readraw cpsbjan07 cpsb0801.dat cpsb0801 151937
readraw cpsbjan07 cpsb0802.dat cpsb0802 152087
readraw cpsbjan07 cpsb0803.dat cpsb0803 151319 
readraw cpsbjan07 cpsb0804.dat cpsb0804 152250 
readraw cpsbjan07 cpsb0805.dat cpsb0805 152408 
readraw cpsbjan07 cpsb0806.dat cpsb0806 152467 
readraw cpsbjan07 cpsb0807.dat cpsb0807 152159 
readraw cpsbjan07 cpsb0808.dat cpsb0808 151908 
readraw cpsbjan07 cpsb0809.dat cpsb0809 151147 
readraw cpsbjan07 cpsb0810.dat cpsb0810 150957 
readraw cpsbjan07 cpsb0811.dat cpsb0811 150799 
readraw cpsbjan07 cpsb0812.dat cpsb0812 149687 

*January 2009-December 2009
readraw cpsbjan09 cpsb0901.dat cpsb0901 151652 
readraw cpsbjan09 cpsb0902.dat cpsb0902 152223 
readraw cpsbjan09 cpsb0903.dat cpsb0903 152216 
readraw cpsbjan09 cpsb0904.dat cpsb0904 153600 
readraw cpsbjan09 cpsb0905.dat cpsb0905 153213 
readraw cpsbjan09 cpsb0906.dat cpsb0906 153100 
readraw cpsbjan09 cpsb0907.dat cpsb0907 152768 
readraw cpsbjan09 cpsb0908.dat cpsb0908 152654 
readraw cpsbjan09 cpsb0909.dat cpsb0909 152274 
readraw cpsbjan09 cpsb0910.dat cpsb0910 152246 
readraw cpsbjan09 cpsb0911.dat cpsb0911 152659 
readraw cpsbjan09 cpsb0912.dat cpsb0912 152260 

*January 2010-Oct 2010
readraw cpsbjan10_modified cpsb1001.dat cpsb1001 152848 
readraw cpsbjan10_modified cpsb1002.dat cpsb1002 153498 
readraw cpsbjan10_modified cpsb1003.dat cpsb1003 153112 
readraw cpsbjan10_modified cpsb1004.dat cpsb1004 154199 
readraw cpsbjan10_modified cpsb1005.dat cpsb1005 153985 
readraw cpsbjan10_modified cpsb1006.dat cpsb1006 153633 
readraw cpsbjan10_modified cpsb1007.dat cpsb1007 153705 
readraw cpsbjan10_modified cpsb1008.dat cpsb1008 153444 
readraw cpsbjan10_modified cpsb1009.dat cpsb1009 152627 
readraw cpsbjan10_modified cpsb1010.dat cpsb1010 152665 

*November 2010-Apr 2012
readraw cpsbjan10_modified nov10pub.dat cpsb1011 152162 
readraw cpsbjan10_modified dec10pub.dat cpsb1012 152384 
readraw cpsbjan10_modified jan11pub.dat cpsb1101 152128 
readraw cpsbjan10_modified feb11pub.dat cpsb1102 151330 
readraw cpsbjan10_modified mar11pub.dat cpsb1103 150600 
readraw cpsbjan10_modified apr11pub.dat cpsb1104 151446 
readraw cpsbjan10_modified may11pub.dat cpsb1105 152320 
readraw cpsbjan10_modified jun11pub.dat cpsb1106 151884 
readraw cpsbjan10_modified jul11pub.dat cpsb1107 152260 
readraw cpsbjan10_modified aug11pub.dat cpsb1108 152438 
readraw cpsbjan10_modified sep11pub.dat cpsb1109 152531 
readraw cpsbjan10_modified oct11pub.dat cpsb1110 152846 
readraw cpsbjan10_modified nov11pub.dat cpsb1111 151776 
readraw cpsbjan10_modified dec11pub.dat cpsb1112 151308 
readraw cpsbjan10_modified jan12pub.dat cpsb1201 151016 
readraw cpsbjan10_modified feb12pub.dat cpsb1202 150654 
readraw cpsbjan10_modified mar12pub.dat cpsb1203 150155 
readraw cpsbjan10_modified apr12pub.dat cpsb1204 151260 


*May 2012-Dec 2012
readraw cpsbmay12 may12pub.dat cpsb1205 151401 
readraw cpsbmay12 jun12pub.dat cpsb1206 151788 
readraw cpsbmay12 jul12pub.dat cpsb1207 151695 
readraw cpsbmay12 aug12pub.dat cpsb1208 151453 
readraw cpsbmay12 sep12pub.dat cpsb1209 151121 
readraw cpsbmay12 oct12pub.dat cpsb1210 150871 
readraw cpsbmay12 nov12pub.dat cpsb1211 151598 
readraw cpsbmay12 dec12pub.dat cpsb1212 151223 

*Jan 2013-Dec 2013
readraw cpsbjan13 jan13pub.dat cpsb1301 151766 
readraw cpsbjan13 feb13pub.dat cpsb1302 150827 
readraw cpsbjan13 mar13pub.dat cpsb1303 150152 
readraw cpsbjan13 apr13pub.dat cpsb1304 151400 
readraw cpsbjan13 may13pub.dat cpsb1305 151969 
readraw cpsbjan13 jun13pub.dat cpsb1306 150808 
readraw cpsbjan13 jul13pub.dat cpsb1307 150308
readraw cpsbjan13 aug13pub.dat cpsb1308 150346 
readraw cpsbjan13 sep13pub.dat cpsb1309 149961 
readraw cpsbjan13 oct13pub.dat cpsb1310 150372 
readraw cpsbjan13 nov13pub.dat cpsb1311 150067 
readraw cpsbjan13 dec13pub.dat cpsb1312 150457 

*Jan 2014-Dec 2014
readraw cpsbjan14 jan14pub.dat cpsb1401 150770 
readraw cpsbjan14 feb14pub.dat cpsb1402 150443 
readraw cpsbjan14 mar14pub.dat cpsb1403 149733
*/

********************************************************************************
* V. Actually Read in Raw Data (04/2014 - )
********************************************************************************
/*

*Apr 2014-Dec 2014
readraw2 cpsbapr14 apr14pub.dat cpsb1404 150022
readraw2 cpsbapr14 may14pub.dat cpsb1405 151439
readraw2 cpsbapr14 jun14pub.dat cpsb1406 151358
readraw2 cpsbapr14 jul14pub.dat cpsb1407 151823
readraw2 cpsbapr14 aug14pub.dat cpsb1408 152232
readraw2 cpsbapr14 sep14pub.dat cpsb1409 152485
readraw2 cpsbapr14 oct14pub.dat cpsb1410 154058
readraw2 cpsbapr14 nov14pub.dat cpsb1411 154242
readraw2 cpsbapr14 dec14pub.dat cpsb1412 152844

*Jan 2015-Jun 2015
readraw2 cpsbjan15 jan15pub.dat cpsb1501 153356 
readraw2 cpsbjan15 feb15pub.dat cpsb1502 151788 
readraw2 cpsbjan15 mar15pub.dat cpsb1503 150907
readraw2 cpsbjan15 apr15pub.dat cpsb1504 151953
readraw2 cpsbjan15 may15pub.dat cpsb1505 151503
readraw2 cpsbjan15 jun15pub.dat cpsb1506 150017

*Jul 2015-Dec 2017
readraw2 cpsbjan15 jul15pub.dat cpsb1507 149416 
readraw2 cpsbjan15 aug15pub.dat cpsb1508 150370 
readraw2 cpsbjan15 sep15pub.dat cpsb1509 150087
readraw2 cpsbjan15 oct15pub.dat cpsb1510 150899
readraw2 cpsbjan15 nov15pub.dat cpsb1511 151115
readraw2 cpsbjan15 dec15pub.dat cpsb1512 150582
readraw2 cpsbjan15 jan16pub.dat cpsb1601 151010
readraw2 cpsbjan15 feb16pub.dat cpsb1602 150294

readraw2 cpsbjan15 mar16pub.dat cpsb1603 148626
readraw2 cpsbjan15 apr16pub.dat cpsb1604 149471
readraw2 cpsbjan15 may16pub.dat cpsb1605 149825

readraw2 cpsbjan15 jun16pub.dat cpsb1606 149692
readraw2 cpsbjan15 jul16pub.dat cpsb1607 150299
readraw2 cpsbjan15 aug16pub.dat cpsb1608 152195
readraw2 cpsbjan15 sep16pub.dat cpsb1609 152739
readraw2 cpsbjan15 oct16pub.dat cpsb1610 152297
readraw2 cpsbjan15 nov16pub.dat cpsb1611 152096
readraw2 cpsbjan15 dec16pub.dat cpsb1612 150688
readraw2 cpsbjan15 jan17pub.dat cpsb1701 150463
readraw2 cpsbjan15 feb17pub.dat cpsb1702 150354
readraw2 cpsbjan15 mar17pub.dat cpsb1703 149331
readraw2 cpsbjan15 apr17pub.dat cpsb1704 149605
readraw2 cpsbjan15 may17pub.dat cpsb1705 148623

readraw2 cpsbjan15 jun17pub.dat cpsb1706 148054
readraw2 cpsbjan15 jul17pub.dat cpsb1707 147629
readraw2 cpsbjan15 aug17pub.dat cpsb1708 147025
readraw2 cpsbjan15 sep17pub.dat cpsb1709 147268
readraw2 cpsbjan15 oct17pub.dat cpsb1710 147618
readraw2 cpsbjan15 nov17pub.dat cpsb1711 147801
readraw2 cpsbjan15 dec17pub.dat cpsb1712 146456

readraw2 cpsbjan15 jan18pub.dat cpsb1801 146142
readraw2 cpsbjan15 feb18pub.dat cpsb1802 145314
readraw2 cpsbjan15 mar18pub.dat cpsb1803 144445
readraw2 cpsbjan15 apr18pub.dat cpsb1804 145110
readraw2 cpsbjan15 may18pub.dat cpsb1805 .
readraw2 cpsbjan15 jun18pub.dat cpsb1806 143688

readraw2 cpsbjan15 jul18pub.dat cpsb1807 142577
readraw2 cpsbjan15 aug18pub.dat cpsb1808 143126
readraw2 cpsbjan15 sep18pub.dat cpsb1809 143963
readraw2 cpsbjan15 oct18pub.dat cpsb1810 143497
readraw2 cpsbjan15 nov18pub.dat cpsb1811 143050
readraw2 cpsbjan15 dec18pub.dat cpsb1812 142044
*/

readraw2 cpsbjan15 jan19pub.dat cpsb1901 141875
readraw2 cpsbjan15 feb19pub.dat cpsb1902 140846
readraw2 cpsbjan15 mar19pub.dat cpsb1903 140220
readraw2 cpsbjan15 apr19pub.dat cpsb1904 141008
readraw2 cpsbjan15 may19pub.dat cpsb1905 139571
readraw2 cpsbjan15 jun19pub.dat cpsb1906 139571
readraw2 cpsbjan15 jul19pub.dat cpsb1907 138495
readraw2 cpsbjan15 aug19pub.dat cpsb1908 139590
readraw2 cpsbjan15 sep19pub.dat cpsb1909 139217
readraw2 cpsbjan15 oct19pub.dat cpsb1910 139219
readraw2 cpsbjan15 nov19pub.dat cpsb1911 138850
readraw2 cpsbjan15 dec19pub.dat cpsb1912 138964

readraw2 cpsbjan15 jan20pub.dat cpsb2001 .
readraw2 cpsbjan15 feb20pub.dat cpsb2002 .
readraw2 cpsbjan15 mar20pub.dat cpsb2003 .
readraw2 cpsbjan15 apr20pub.dat cpsb2004 .



cap log close
cap log close readrawcps
* Modified: Nicolas Ghio, 8/23/2018: Updated through 7/19 CPS.
* Modified: Nathaniel Ruby, 8/23/2018: Updated through 6/18 CPS.
* Modified: Rachel Young, 5/16/2018: Updated through 12/17 CPS
* Modified: Rachel Young, 1/4/2018: Revised to extend back to 1979. 
* Modified: Jesse Rothstein, 12/28/15: Updated through 11/15 CPS
* Modified: Peter Jones on 5/22/15
* Previously Modified: Apurba Chakraborty (5/2/14)
* Created: Tommy Drake (8/11/11)
********************************************************************************
/*Notes:
	
	0) Updated 5/22/15 to include data through 4/15, 7/11/17 for data through 5/17

	1) Individual do files and dictionaries are directly from NBER. This
	program is a master read in for all of those do files.
	
	2) A period is added after the ${rawdata} in all of the NBER do files
	for raw data that does not have a suffix.
	
	3) There was an issue with disk quota so all basedata files are
	currently being compressed using gzip.
	
	4) The observations counts from http://thedataweb.rm.census.gov/ftp/cps_ftp.html
	to check that all obs were read in correctly. The actual counts don't 
	match the CPS counts in certain years, so this should be checked later.
	
	5) Jan 2010 NBER program was modified to read in all vars instead of
	just the given subset.
	
	6) The jan89 and jan92 dictionary files were incorrectly reading the
	adult final weight as longs instead of doubles.  The dictionary files
	were modified to change this and now are labeled as _modified.  The
	dictionary path in the jan89 and jan92 nber .do files was also
	modified to use these new dictionaries.
	
	7) Program Documentation: cr_cpsb                                     
	
	8) The program was written to run under version 13. To run under version 14,
	   and still produce files that can be read under version 11, it seems
	   that it will be necessary to edit the saveold statement in each of the cps 
	   read files.
	   
	9) Several global directories are hard-coded. See section I below.
*/
	
********************************************************************************
capture log close
log using readrawcps.log, replace 
set more off
clear *
program drop _all
set memory 1000m
set type double, perm
version 14

********************************************************************************
* I. Configure Directories
********************************************************************************
global scratch = "~/labormarket"
global cps     = "~/data/cps/bigcps/statafmt"
global rawcps  = "~/data/cps/bigcps/raw"
global rawdir  = "$scratch"
global progdir = "cpssupplemental"
global dictdir = "cpssupplemental"
global basedir = "$cps"

cd ~/data/cps/bigcps/programs
********************************************************************************
* II. Define Program to Read in Raw Data (01/1978 - 03/2014)
********************************************************************************

// 1: program name, 2: raw dataset name, 3: base dataset name, 4: obs count
program readraw 
	global pgm = "`1'"
	global rawdata = "tmp_`2'"
	global basedata = "`3'"
	!zcat ${rawcps}/`2'.Z > ${rawdir}/tmp_`2'
	clear *
	do ${progdir}/`1'.do
	if `4'~=. {
		assert _N==`4'
	}
	!rm -f ${rawdir}/tmp_`2'
	!rm -f ${basedir}/${basedata}.dta.gbytez
	!gzip ${basedir}/${basedata}.dta
	macro drop pgm rawdata basedata
end



********************************************************************************
* IV. Define Program to Read in Raw Data (04/2014 - )
********************************************************************************
// Defines readraw2 which is readraw for .gz instead of .Z raw files
// Code would not run with this program defined above, which explains the order
program readraw2 
	global pgm = "`1'"
	global rawdata = "tmp_`2'"
	global basedata = "`3'"
	!zcat ${rawcps}/`2'.gz > ${rawdir}/tmp_`2' // only change vs. readraw
	clear *
	do ${progdir}/`1'.do
	if `4'~=. {
		assert _N==`4'
	}
	!rm -f ${rawdir}/tmp_`2'
	!rm -f ${basedir}/${basedata}.dta.gz
	!gzip ${basedir}/${basedata}.dta
	macro drop pgm rawdata basedata
end



********************************************************************************
* III. Actually Read in Raw Data (01/1978 - 06/2015)
********************************************************************************

*January 1979-December 1981

/*

forvalues yy=80/81 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps81 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}


forvalues yy=79/79 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps76 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}
forvalues yy=82/82 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps82 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}

*January 1983-December 1988
forvalues yy=83/83 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps83 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}

forvalues yy=84/84 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps84 cpsb`yy'`mm' cpsb`yy'`mm' .
	}
}

forvalues yy=85/85 {
	foreach mm in 01 02 03 04 05 06  {
		readraw readcps84 cpsb`yy'`mm' cpsb`yy'`mm' .
		}
}

forvalues yy=85/85 {
	foreach mm in 07 08 09 10 11 12 {
		readraw readcps85 cpsb`yy'`mm' cpsb`yy'`mm' .
		}
}

forvalues yy=86/88 {
	foreach mm in 01 02 03 04 05 06 07 08 09 10 11 12  {
		readraw readcps86 cpsb`yy'`mm' cpsb`yy'`mm' . 
	}
}




*January 1989-December 1991
readraw cpsbjan89 cpsb8901 cpsb8901 .
readraw cpsbjan89 cpsb8902 cpsb8902 .
readraw cpsbjan89 cpsb8903 cpsb8903 .
readraw cpsbjan89 cpsb8904 cpsb8904 .
readraw cpsbjan89 cpsb8905 cpsb8905 .
readraw cpsbjan89 cpsb8906 cpsb8906 .
readraw cpsbjan89 cpsb8907 cpsb8907 .
readraw cpsbjan89 cpsb8908 cpsb8908 .
readraw cpsbjan89 cpsb8909 cpsb8909 .
readraw cpsbjan89 cpsb8910 cpsb8910 .
readraw cpsbjan89 cpsb8911 cpsb8911 .
readraw cpsbjan89 cpsb8912 cpsb8912 .
readraw cpsbjan89 cpsb9001 cpsb9001 .
readraw cpsbjan89 cpsb9002 cpsb9002 .
readraw cpsbjan89 cpsb9003 cpsb9003 .
readraw cpsbjan89 cpsb9004 cpsb9004 .
readraw cpsbjan89 cpsb9005 cpsb9005 .
readraw cpsbjan89 cpsb9006 cpsb9006 .
readraw cpsbjan89 cpsb9007 cpsb9007 .
readraw cpsbjan89 cpsb9008 cpsb9008 .
readraw cpsbjan89 cpsb9009 cpsb9009 .
readraw cpsbjan89 cpsb9010 cpsb9010 .
readraw cpsbjan89 cpsb9011 cpsb9011 .
readraw cpsbjan89 cpsb9012 cpsb9012 .
readraw cpsbjan89 cpsb9101 cpsb9101 .
readraw cpsbjan89 cpsb9102 cpsb9102 .
readraw cpsbjan89 cpsb9103 cpsb9103 .
readraw cpsbjan89 cpsb9104 cpsb9104 .
readraw cpsbjan89 cpsb9105 cpsb9105 .
readraw cpsbjan89 cpsb9106 cpsb9106 .
readraw cpsbjan89 cpsb9107 cpsb9107 .
readraw cpsbjan89 cpsb9108 cpsb9108 .
readraw cpsbjan89 cpsb9109 cpsb9109 .
readraw cpsbjan89 cpsb9110 cpsb9110 .
readraw cpsbjan89 cpsb9111 cpsb9111 .
readraw cpsbjan89 cpsb9112 cpsb9112 .


*January 1992-December 1993
readraw cpsbjan92 cpsb9201 cpsb9201 .
readraw cpsbjan92 cpsb9202 cpsb9202 .
readraw cpsbjan92 cpsb9203 cpsb9203 .
readraw cpsbjan92 cpsb9204 cpsb9204 .
readraw cpsbjan92 cpsb9205 cpsb9205 .
readraw cpsbjan92 cpsb9206 cpsb9206 .
readraw cpsbjan92 cpsb9207 cpsb9207 .
readraw cpsbjan92 cpsb9208 cpsb9208 .
readraw cpsbjan92 cpsb9209 cpsb9209 .
readraw cpsbjan92 cpsb9210 cpsb9210 .
readraw cpsbjan92 cpsb9211 cpsb9211 .
readraw cpsbjan92 cpsb9212 cpsb9212 .
readraw cpsbjan92 cpsb9301 cpsb9301 .
readraw cpsbjan92 cpsb9302 cpsb9302 .
readraw cpsbjan92 cpsb9303 cpsb9303 .
readraw cpsbjan92 cpsb9304 cpsb9304 .
readraw cpsbjan92 cpsb9305 cpsb9305 .
readraw cpsbjan92 cpsb9306 cpsb9306 .
readraw cpsbjan92 cpsb9307 cpsb9307 .
readraw cpsbjan92 cpsb9308 cpsb9308 .
readraw cpsbjan92 cpsb9309 cpsb9309 .
readraw cpsbjan92 cpsb9310 cpsb9310 .
readraw cpsbjan92 cpsb9311 cpsb9311 .
readraw cpsbjan92 cpsb9312 cpsb9312 .


*January 1994-March 1994
readraw cpsbjan94 cpsb9401 cpsb9401 156337
readraw cpsbjan94 cpsb9402 cpsb9402 156246
readraw cpsbjan94 cpsb9403 cpsb9403 156011

*April 1994-May 1995
readraw cpsbapr94 cpsb9404 cpsb9404 155618
readraw cpsbapr94 cpsb9405 cpsb9405 154665
readraw cpsbapr94 cpsb9406 cpsb9406 153572
readraw cpsbapr94 cpsb9407 cpsb9407 152303 //Given number is 151615
readraw cpsbapr94 cpsb9408 cpsb9408 151615
readraw cpsbapr94 cpsb9409 cpsb9409 151374
readraw cpsbapr94 cpsb9410 cpsb9410 153030
readraw cpsbapr94 cpsb9411 cpsb9411 153456 //Given number is 153238
readraw cpsbapr94 cpsb9412 cpsb9412 153238
readraw cpsbapr94 cpsb9501 cpsb9501 154317
readraw cpsbapr94 cpsb9502 cpsb9502 153530
readraw cpsbapr94 cpsb9503 cpsb9503 153380
readraw cpsbapr94 cpsb9504 cpsb9504 153418
readraw cpsbapr94 cpsb9505 cpsb9505 153817 //Given number is 153530

*June 1995-August 1995
readraw cpsbjun95 cpsb9506 cpsb9506 154299
readraw cpsbjun95 cpsb9507 cpsb9507 153720
readraw cpsbjun95 cpsb9508 cpsb9508 154227 //Given number is 154072

*September 1995-December 1997
readraw cpsbsep95 cpsb9509 cpsb9509 148986
readraw cpsbsep95 cpsb9510 cpsb9510 148392 
readraw cpsbsep95 cpsb9511 cpsb9511 148390 //Given number is 133424
readraw cpsbsep95 cpsb9512 cpsb9512 146878 
readraw cpsbsep95 cpsb9601 cpsb9601 132951 //Given number is 133424
readraw cpsbsep95 cpsb9602 cpsb9602 133424
readraw cpsbsep95 cpsb9603 cpsb9603 133240
readraw cpsbsep95 cpsb9604 cpsb9604 134340
readraw cpsbsep95 cpsb9605 cpsb9605 134271
readraw cpsbsep95 cpsb9606 cpsb9606 134753
readraw cpsbsep95 cpsb9607 cpsb9607 134509
readraw cpsbsep95 cpsb9608 cpsb9608 134817
readraw cpsbsep95 cpsb9609 cpsb9609 135479
readraw cpsbsep95 cpsb9610 cpsb9610 135845
readraw cpsbsep95 cpsb9611 cpsb9611 136279 //Given number is 136242
readraw cpsbsep95 cpsb9612 cpsb9612 136242
readraw cpsbsep95 cpsb9701 cpsb9701 135326
readraw cpsbsep95 cpsb9702 cpsb9702 134378
readraw cpsbsep95 cpsb9703 cpsb9703 134070
readraw cpsbsep95 cpsb9704 cpsb9704 134538
readraw cpsbsep95 cpsb9705 cpsb9705 135116
readraw cpsbsep95 cpsb9706 cpsb9706 135323
readraw cpsbsep95 cpsb9707 cpsb9707 134589
readraw cpsbsep95 cpsb9708 cpsb9708 135259
readraw cpsbsep95 cpsb9709 cpsb9709 135984
readraw cpsbsep95 cpsb9710 cpsb9710 135599
readraw cpsbsep95 cpsb9711 cpsb9711 135785
readraw cpsbsep95 cpsb9712 cpsb9712 135009

*January 1998-December 2002
readraw cpsbjan98 jan98pub.cps cpsb9801 134961
readraw cpsbjan98 feb98pub.cps cpsb9802 134413
readraw cpsbjan98 mar98pub.cps cpsb9803 134134
readraw cpsbjan98 apr98pub.cps cpsb9804 134516
readraw cpsbjan98 may98pub.cps cpsb9805 135411
readraw cpsbjan98 jun98pub.cps cpsb9806 134996
readraw cpsbjan98 jul98pub.cps cpsb9807 134948
readraw cpsbjan98 aug98pub.cps cpsb9808 135216
readraw cpsbjan98 sep98pub.cps cpsb9809 135549
readraw cpsbjan98 oct98pub.cps cpsb9810 135673
readraw cpsbjan98 nov98pub.cps cpsb9811 136186
readraw cpsbjan98 dec98pub.cps cpsb9812 135977
readraw cpsbjan98 jan99pub.cps cpsb9901 135889
readraw cpsbjan98 feb99pub.cps cpsb9902 135051
readraw cpsbjan98 mar99pub.cps cpsb9903 134693
readraw cpsbjan98 apr99pub.cps cpsb9904 134951
readraw cpsbjan98 may99pub.cps cpsb9905 134994
readraw cpsbjan98 jun99pub.cps cpsb9906 135577
readraw cpsbjan98 jul99pub.cps cpsb9907 135522
readraw cpsbjan98 aug99pub.cps cpsb9908 136259
readraw cpsbjan98 sep99pub.cps cpsb9909 136622
readraw cpsbjan98 oct99pub.cps cpsb9910 136710
readraw cpsbjan98 nov99pub.cps cpsb9911 137790
readraw cpsbjan98 dec99pub.cps cpsb9912 136387
readraw cpsbjan98 jan00pub.cps cpsb0001 137006
readraw cpsbjan98 feb00pub.cps cpsb0002 135570
readraw cpsbjan98 mar00pub.cps cpsb0003 134462
readraw cpsbjan98 apr00pub.cps cpsb0004 135624
readraw cpsbjan98 may00pub.cps cpsb0005 135557
readraw cpsbjan98 jun00pub.cps cpsb0006 135488 //Given number is 135448
readraw cpsbjan98 jul00pub.cps cpsb0007 135163
readraw cpsbjan98 aug00pub.cps cpsb0008 134986
readraw cpsbjan98 sep00pub.cps cpsb0009 134856
readraw cpsbjan98 oct00pub.cps cpsb0010 135283
readraw cpsbjan98 nov00pub.cps cpsb0011 134723
readraw cpsbjan98 dec00pub.cps cpsb0012 133870
readraw cpsbjan98 jan01pub.cps cpsb0101 133284
readraw cpsbjan98 feb01pub.cps cpsb0102 132182
readraw cpsbjan98 mar01pub.cps cpsb0103 130607
readraw cpsbjan98 apr01pub.cps cpsb0104 131302
readraw cpsbjan98 may01pub.cps cpsb0105 131997
readraw cpsbjan98 jun01pub.cps cpsb0106 131651
readraw cpsbjan98 jul01pub.cps cpsb0107 158353
readraw cpsbjan98 aug01pub.cps cpsb0108 158911
readraw cpsbjan98 sep01pub.cps cpsb0109 158865
readraw cpsbjan98 oct01pub.cps cpsb0110 158819
readraw cpsbjan98 nov01pub.cps cpsb0111 158335
readraw cpsbjan98 dec01pub.cps cpsb0112 157937
readraw cpsbjan98 jan02pub.cps cpsb0201 157946
readraw cpsbjan98 feb02pub.cps cpsb0202 157443
readraw cpsbjan98 mar02pub.cps cpsb0203 156821
readraw cpsbjan98 apr02pub.cps cpsb0204 158107
readraw cpsbjan98 may02pub.cps cpsb0205 158493
readraw cpsbjan98 jun02pub.cps cpsb0206 158681
readraw cpsbjan98 jul02pub.cps cpsb0207 159245
readraw cpsbjan98 aug02pub.cps cpsb0208 159058
readraw cpsbjan98 sep02pub.cps cpsb0209 159434
readraw cpsbjan98 oct02pub.cps cpsb0210 159887
readraw cpsbjan98 nov02pub.cps cpsb0211 159713
readraw cpsbjan98 dec02pub.cps cpsb0212 159657

*January 2003-April 2004
readraw cpsbjan03 jan03pub.cps cpsb0301 159376
readraw cpsbjan03 feb03pub.cps cpsb0302 158633
readraw cpsbjan03 mar03pub.cps cpsb0303 158721
readraw cpsbjan03 apr03pub.cps cpsb0304 159040
readraw cpsbjan03 may03pub.cps cpsb0305 158826
readraw cpsbjan03 jun03pub.cps cpsb0306 157585
readraw cpsbjan03 jul03pub.cps cpsb0307 156989
readraw cpsbjan03 aug03pub.cps cpsb0308 156654
readraw cpsbjan03 sep03pub.cps cpsb0309 157367
readraw cpsbjan03 oct03pub.cps cpsb0310 156941
readraw cpsbjan03 nov03pub.cps cpsb0311 156869
readraw cpsbjan03 dec03pub.cps cpsb0312 156967
readraw cpsbjan03 cpsb0401.dat cpsb0401 156887
readraw cpsbjan03 cpsb0402.dat cpsb0402 157544
readraw cpsbjan03 cpsb0403.dat cpsb0403 156542
readraw cpsbjan03 cpsb0404.dat cpsb0404 155410

*May 2004-July 2005
readraw cpsbmay04 cpsb0405.dat cpsb0405 155064
readraw cpsbmay04 cpsb0406.dat cpsb0406 153879
readraw cpsbmay04 cpsb0407.dat cpsb0407 152475
readraw cpsbmay04 cpsb0408.dat cpsb0408 153896
readraw cpsbmay04 cpsb0409.dat cpsb0409 154495
readraw cpsbmay04 cpsb0410.dat cpsb0410 155365
readraw cpsbmay04 cpsb0411.dat cpsb0411 156519
readraw cpsbmay04 cpsb0412.dat cpsb0412 155845
readraw cpsbmay04 cpsb0501.dat cpsb0501 156657
readraw cpsbmay04 cpsb0502.dat cpsb0502 155925
readraw cpsbmay04 cpsb0503.dat cpsb0503 154651
readraw cpsbmay04 cpsb0504.dat cpsb0504 155041
readraw cpsbmay04 cpsb0505.dat cpsb0505 154707
readraw cpsbmay04 cpsb0506.dat cpsb0506 154050
readraw cpsbmay04 cpsb0507.dat cpsb0507 153893

*August 2005-December 2006
readraw cpsbaug05 cpsb0508.dat cpsb0508 153649
readraw cpsbaug05 cpsb0509.dat cpsb0509 153087
readraw cpsbaug05 cpsb0510.dat cpsb0510 153937
readraw cpsbaug05 cpsb0511.dat cpsb0511 153636
readraw cpsbaug05 cpsb0512.dat cpsb0512 153049
readraw cpsbaug05 cpsb0601.dat cpsb0601 153550
readraw cpsbaug05 cpsb0602.dat cpsb0602 153382
readraw cpsbaug05 cpsb0603.dat cpsb0603 152738
readraw cpsbaug05 cpsb0604.dat cpsb0604 153597
readraw cpsbaug05 cpsb0605.dat cpsb0605 153344
readraw cpsbaug05 cpsb0606.dat cpsb0606 153219
readraw cpsbaug05 cpsb0607.dat cpsb0607 153525
readraw cpsbaug05 cpsb0608.dat cpsb0608 154149
readraw cpsbaug05 cpsb0609.dat cpsb0609 153397
readraw cpsbaug05 cpsb0610.dat cpsb0610 153244
readraw cpsbaug05 cpsb0611.dat cpsb0611 153255
readraw cpsbaug05 cpsb0612.dat cpsb0612 152962

*January 2007-December 2008
readraw cpsbjan07 cpsb0701.dat cpsb0701 152318
readraw cpsbjan07 cpsb0702.dat cpsb0702 152581
readraw cpsbjan07 cpsb0703.dat cpsb0703 152390
readraw cpsbjan07 cpsb0704.dat cpsb0704 153700
readraw cpsbjan07 cpsb0705.dat cpsb0705 154210
readraw cpsbjan07 cpsb0706.dat cpsb0706 153629
readraw cpsbjan07 cpsb0707.dat cpsb0707 152802
readraw cpsbjan07 cpsb0708.dat cpsb0708 152331
readraw cpsbjan07 cpsb0709.dat cpsb0709 151968
readraw cpsbjan07 cpsb0710.dat cpsb0710 151370
readraw cpsbjan07 cpsb0711.dat cpsb0711 151671 
readraw cpsbjan07 cpsb0712.dat cpsb0712 151431
readraw cpsbjan07 cpsb0801.dat cpsb0801 151937
readraw cpsbjan07 cpsb0802.dat cpsb0802 152087
readraw cpsbjan07 cpsb0803.dat cpsb0803 151319 
readraw cpsbjan07 cpsb0804.dat cpsb0804 152250 
readraw cpsbjan07 cpsb0805.dat cpsb0805 152408 
readraw cpsbjan07 cpsb0806.dat cpsb0806 152467 
readraw cpsbjan07 cpsb0807.dat cpsb0807 152159 
readraw cpsbjan07 cpsb0808.dat cpsb0808 151908 
readraw cpsbjan07 cpsb0809.dat cpsb0809 151147 
readraw cpsbjan07 cpsb0810.dat cpsb0810 150957 
readraw cpsbjan07 cpsb0811.dat cpsb0811 150799 
readraw cpsbjan07 cpsb0812.dat cpsb0812 149687 

*January 2009-December 2009
readraw cpsbjan09 cpsb0901.dat cpsb0901 151652 
readraw cpsbjan09 cpsb0902.dat cpsb0902 152223 
readraw cpsbjan09 cpsb0903.dat cpsb0903 152216 
readraw cpsbjan09 cpsb0904.dat cpsb0904 153600 
readraw cpsbjan09 cpsb0905.dat cpsb0905 153213 
readraw cpsbjan09 cpsb0906.dat cpsb0906 153100 
readraw cpsbjan09 cpsb0907.dat cpsb0907 152768 
readraw cpsbjan09 cpsb0908.dat cpsb0908 152654 
readraw cpsbjan09 cpsb0909.dat cpsb0909 152274 
readraw cpsbjan09 cpsb0910.dat cpsb0910 152246 
readraw cpsbjan09 cpsb0911.dat cpsb0911 152659 
readraw cpsbjan09 cpsb0912.dat cpsb0912 152260 

*January 2010-Oct 2010
readraw cpsbjan10_modified cpsb1001.dat cpsb1001 152848 
readraw cpsbjan10_modified cpsb1002.dat cpsb1002 153498 
readraw cpsbjan10_modified cpsb1003.dat cpsb1003 153112 
readraw cpsbjan10_modified cpsb1004.dat cpsb1004 154199 
readraw cpsbjan10_modified cpsb1005.dat cpsb1005 153985 
readraw cpsbjan10_modified cpsb1006.dat cpsb1006 153633 
readraw cpsbjan10_modified cpsb1007.dat cpsb1007 153705 
readraw cpsbjan10_modified cpsb1008.dat cpsb1008 153444 
readraw cpsbjan10_modified cpsb1009.dat cpsb1009 152627 
readraw cpsbjan10_modified cpsb1010.dat cpsb1010 152665 

*November 2010-Apr 2012
readraw cpsbjan10_modified nov10pub.dat cpsb1011 152162 
readraw cpsbjan10_modified dec10pub.dat cpsb1012 152384 
readraw cpsbjan10_modified jan11pub.dat cpsb1101 152128 
readraw cpsbjan10_modified feb11pub.dat cpsb1102 151330 
readraw cpsbjan10_modified mar11pub.dat cpsb1103 150600 
readraw cpsbjan10_modified apr11pub.dat cpsb1104 151446 
readraw cpsbjan10_modified may11pub.dat cpsb1105 152320 
readraw cpsbjan10_modified jun11pub.dat cpsb1106 151884 
readraw cpsbjan10_modified jul11pub.dat cpsb1107 152260 
readraw cpsbjan10_modified aug11pub.dat cpsb1108 152438 
readraw cpsbjan10_modified sep11pub.dat cpsb1109 152531 
readraw cpsbjan10_modified oct11pub.dat cpsb1110 152846 
readraw cpsbjan10_modified nov11pub.dat cpsb1111 151776 
readraw cpsbjan10_modified dec11pub.dat cpsb1112 151308 
readraw cpsbjan10_modified jan12pub.dat cpsb1201 151016 
readraw cpsbjan10_modified feb12pub.dat cpsb1202 150654 
readraw cpsbjan10_modified mar12pub.dat cpsb1203 150155 
readraw cpsbjan10_modified apr12pub.dat cpsb1204 151260 


*May 2012-Dec 2012
readraw cpsbmay12 may12pub.dat cpsb1205 151401 
readraw cpsbmay12 jun12pub.dat cpsb1206 151788 
readraw cpsbmay12 jul12pub.dat cpsb1207 151695 
readraw cpsbmay12 aug12pub.dat cpsb1208 151453 
readraw cpsbmay12 sep12pub.dat cpsb1209 151121 
readraw cpsbmay12 oct12pub.dat cpsb1210 150871 
readraw cpsbmay12 nov12pub.dat cpsb1211 151598 
readraw cpsbmay12 dec12pub.dat cpsb1212 151223 

*Jan 2013-Dec 2013
readraw cpsbjan13 jan13pub.dat cpsb1301 151766 
readraw cpsbjan13 feb13pub.dat cpsb1302 150827 
readraw cpsbjan13 mar13pub.dat cpsb1303 150152 
readraw cpsbjan13 apr13pub.dat cpsb1304 151400 
readraw cpsbjan13 may13pub.dat cpsb1305 151969 
readraw cpsbjan13 jun13pub.dat cpsb1306 150808 
readraw cpsbjan13 jul13pub.dat cpsb1307 150308
readraw cpsbjan13 aug13pub.dat cpsb1308 150346 
readraw cpsbjan13 sep13pub.dat cpsb1309 149961 
readraw cpsbjan13 oct13pub.dat cpsb1310 150372 
readraw cpsbjan13 nov13pub.dat cpsb1311 150067 
readraw cpsbjan13 dec13pub.dat cpsb1312 150457 

*Jan 2014-Dec 2014
readraw cpsbjan14 jan14pub.dat cpsb1401 150770 
readraw cpsbjan14 feb14pub.dat cpsb1402 150443 
readraw cpsbjan14 mar14pub.dat cpsb1403 149733
*/

********************************************************************************
* V. Actually Read in Raw Data (04/2014 - )
********************************************************************************
/*
*Apr 2014-Dec 2014
readraw2 cpsbapr14 apr14pub.dat cpsb1404 150022
readraw2 cpsbapr14 may14pub.dat cpsb1405 151439
readraw2 cpsbapr14 jun14pub.dat cpsb1406 151358
readraw2 cpsbapr14 jul14pub.dat cpsb1407 151823
readraw2 cpsbapr14 aug14pub.dat cpsb1408 152232
readraw2 cpsbapr14 sep14pub.dat cpsb1409 152485
readraw2 cpsbapr14 oct14pub.dat cpsb1410 154058
readraw2 cpsbapr14 nov14pub.dat cpsb1411 154242
readraw2 cpsbapr14 dec14pub.dat cpsb1412 152844

*Jan 2015-Jun 2015
readraw2 cpsbjan15 jan15pub.dat cpsb1501 153356 
readraw2 cpsbjan15 feb15pub.dat cpsb1502 151788 
readraw2 cpsbjan15 mar15pub.dat cpsb1503 150907
readraw2 cpsbjan15 apr15pub.dat cpsb1504 151953
readraw2 cpsbjan15 may15pub.dat cpsb1505 151503
readraw2 cpsbjan15 jun15pub.dat cpsb1506 150017

*Jul 2015-Dec 2017
readraw2 cpsbjan15 jul15pub.dat cpsb1507 149416 
readraw2 cpsbjan15 aug15pub.dat cpsb1508 150370 
readraw2 cpsbjan15 sep15pub.dat cpsb1509 150087
readraw2 cpsbjan15 oct15pub.dat cpsb1510 150899
readraw2 cpsbjan15 nov15pub.dat cpsb1511 151115
readraw2 cpsbjan15 dec15pub.dat cpsb1512 150582
readraw2 cpsbjan15 jan16pub.dat cpsb1601 151010
readraw2 cpsbjan15 feb16pub.dat cpsb1602 150294

readraw2 cpsbjan15 mar16pub.dat cpsb1603 148626
readraw2 cpsbjan15 apr16pub.dat cpsb1604 149471
readraw2 cpsbjan15 may16pub.dat cpsb1605 149825

readraw2 cpsbjan15 jun16pub.dat cpsb1606 149692
readraw2 cpsbjan15 jul16pub.dat cpsb1607 150299
readraw2 cpsbjan15 aug16pub.dat cpsb1608 152195
readraw2 cpsbjan15 sep16pub.dat cpsb1609 152739
readraw2 cpsbjan15 oct16pub.dat cpsb1610 152297
readraw2 cpsbjan15 nov16pub.dat cpsb1611 152096
readraw2 cpsbjan15 dec16pub.dat cpsb1612 150688
readraw2 cpsbjan15 jan17pub.dat cpsb1701 150463
readraw2 cpsbjan15 feb17pub.dat cpsb1702 150354
readraw2 cpsbjan15 mar17pub.dat cpsb1703 149331
readraw2 cpsbjan15 apr17pub.dat cpsb1704 149605
readraw2 cpsbjan15 may17pub.dat cpsb1705 148623
*/
readraw2 cpsbjan15 jun17pub.dat cpsb1706 148054
readraw2 cpsbjan15 jul17pub.dat cpsb1707 147629
readraw2 cpsbjan15 aug17pub.dat cpsb1708 147025
readraw2 cpsbjan15 sep17pub.dat cpsb1709 147268
readraw2 cpsbjan15 oct17pub.dat cpsb1710 147618
readraw2 cpsbjan15 nov17pub.dat cpsb1711 147801
readraw2 cpsbjan15 dec17pub.dat cpsb1712 146456

readraw2 cpsbjan15 jan18pub.dat cpsb1801 146142
readraw2 cpsbjan15 feb18pub.dat cpsb1802 145314
readraw2 cpsbjan15 mar18pub.dat cpsb1803 144445
readraw2 cpsbjan15 apr18pub.dat cpsb1804 145110
readraw2 cpsbjan15 may18pub.dat cpsb1805 .
readraw2 cpsbjan15 jun18pub.dat cpsb1806 143688

readraw2 cpsbjan15 jul18pub.dat cpsb1807 142577
readraw2 cpsbjan15 aug18pub.dat cpsb1808 143126
readraw2 cpsbjan15 sep18pub.dat cpsb1809 143963
readraw2 cpsbjan15 oct18pub.dat cpsb1810 143497
readraw2 cpsbjan15 nov18pub.dat cpsb1811 143050
*/
/* 

readraw2 cpsbjan15 dec18pub.dat cpsb1812 142044
readraw2 cpsbjan15 jan19pub.dat cpsb1901 141875
readraw2 cpsbjan15 feb19pub.dat cpsb1902 140846
readraw2 cpsbjan15 mar19pub.dat cpsb1903 140220
readraw2 cpsbjan15 apr19pub.dat cpsb1904 141008
readraw2 cpsbjan15 may19pub.dat cpsb1905 139571
readraw2 cpsbjan15 jun19pub.dat cpsb1906 139571
readraw2 cpsbjan15 jul19pub.dat cpsb1907 138495
readraw2 cpsbjan15 aug19pub.dat cpsb1908 139590
readraw2 cpsbjan15 sep19pub.dat cpsb1909 139217
readraw2 cpsbjan15 oct19pub.dat cpsb1910 139219
readraw2 cpsbjan15 nov19pub.dat cpsb1911 138850
readraw2 cpsbjan15 dec19pub.dat cpsb1912 138964
*/


cap log close
cap log close readrawcps
